package com.jf.controller;

import com.jf.util.MyUtils;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/page")
public class PageServlet extends HttpServlet {
    @Override
    protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String param = request.getParameter("param");
        if(MyUtils.isStringEmpty(param) || "home".equals(param)){
            request.getRequestDispatcher("/WEB-INF/pages/admin/home.jsp").forward(request,response);
        }
        if("welcome".equals(param)){
            request.getRequestDispatcher("/WEB-INF/pages/admin/welcome.jsp").forward(request,response);
        }
    }
}
